<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>反转拖拽示例</title>
  <link rel="stylesheet" href="jquery-ui-1.10.4/css/ui-lightness/jquery-ui-1.10.4.css">
  <script src="jquery-ui-1.10.4/js/jquery-1.10.2.js"></script>
  <script src="jquery-ui-1.10.4/js/jquery-ui-1.10.4.js"></script>
  <style>
  #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
  </style>
  <script type="text/javascript">
	  $(function() {
		$( "#draggable" ).draggable({ revert: true });    //进行拖拽反转
		//反转拖拽，以复制的方式拖拽
		$( "#draggable2" ).draggable({ revert: true, helper: "clone" });
	  });
  </script>
</head>
<body>
 
<div id="draggable" class="ui-widget-content">
  <p>恢复的原来的位置</p>
</div>
 
<div id="draggable2" class="ui-widget-content">
  <p>以复制的方式拖动并恢复到原来的位置</p>
</div>
</body>
</html>
